<template>
  <div>
    <div>
      <el-input v-model="keyword_" :clearable="true" style="width: 200px" placeholder="主机关键字" @change="changeKeyword" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'HostFilter',
  props: {
    keyword: {
      type: String,
      default: null
    }
  },
  data() {
    return {
      keyword_: this.keyword
    }
  },
  watch: {
    keyword: function() {
      this.keyword_ = this.keyword
    }
  },
  methods: {
    changeKeyword() {
      this.$emit('update:keyword', this.keyword_)
      this.$emit('success')
    }
  }
}
</script>
